package com.lele.controller;


import com.lele.pojo.Admin;
import com.lele.service.IAdminRoleService;
import com.lele.service.IAdminService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lele
 * @since 2022-11-26
 */
@RestController
@RequestMapping("/system/admin")
public class AdminController {
    @Resource
    private IAdminService adminService;

    @GetMapping("hello")
    public List<Admin> hello(){
        List<Admin> list = adminService.list();
        return list;
    }


    /**
     * 获取操作员的对应的权限，不用获取自己的权限
     */
    @GetMapping("/")
    public List<Admin> getAdminAndRoles(@RequestParam("keywords") String keywords){
        List<Admin> adminList=adminService.getAllAdmin(keywords);
        return adminList;
    }

}
